#ifndef GETCOLORSIMILARITY_H_2010_1_21
#define GETCOLORSIMILARITY_H_2010_1_21
#include "Pretreatment.h"
#include <vector>

using namespace std;

typedef struct tagPointInfo
{
	int x;
	int y;
	int iSimilarity;
	//int iRegionx;
	//int iRegiony;
} PointInfo;


class GetColorSimilarity:public Pretreatment
{
public:
	GetColorSimilarity(){};
	~GetColorSimilarity();
	PointInfo GetClosestPoint();
	void Init(MethodContainer *pMet,int iLeft,int iTop,int iWidth,int iHeight,int iRegionLength);
	long SetSample(vector<BYTE> * pSampleBmpValue,int iRegionLength);
	LOG4CPLUS_CLASS_DECLARE(_logger)
	int m_isUninited;
protected:
	int *m_pSimilarityInt;
	void Run(void);
	void Run2(void);
	double *m_pSimilarityDouble;
	vector<PointInfo> m_closestPoints;
	int m_iAreaTop;
	int m_iAreaLeft;
	int m_iAreaWidth;
	int m_iAreaHeight;
	int m_iRegionLength;
	void GetClosestPointsInRegions();
	int IsUnacceptableAngle(int x,int y);
	vector<BYTE>* m_ppSampleBmpValue[3];
};


#endif